package oop.basicConcept;

/*
    定义一个厨师类（Chef）,并为厨师类定义制作牛肉面的重载方法cookNoodle()
    尺寸：size  (大碗还是小碗) 大碗10元，小碗8元
    是否加肉：beef  :加肉+5元
    加蛋的数量：eggs  :每个2元；
 */
public class Chef {

    int bigSingle = 10;
    int smallSingle = 8;

    String ifBeef = "不加";
    String type = "大";

    //默认为大碗
    int cookNoodle(){
        return this.bigSingle;
    }

    //1为大碗，其它数字为小碗
    int cookNoodle(int size){
        int price = 0;
        if(size == 1){
            price = this.bigSingle;
        }else{
            price = this.smallSingle;
        }
        return price;
    }

    int cookNoodle(int size,boolean beef){
        int price = 0;
        if(size == 1){
            price = this.bigSingle;
        }else{
            price = this.smallSingle;
        }

        if(beef){
            price += 5;
        }

        return price;
    }


    int cookNoodle(int size,boolean beef,int eggs){
        int price = 0;

        if(size == 1){
            price = this.bigSingle;
        }else{
            type = "小";
            price = this.smallSingle;
        }

        if(beef){
            ifBeef = "加";
            price += 5;
        }

        price+=2*eggs;

        System.out.println("你购买的面加"+eggs+"个蛋，"+ifBeef+"肉的"+type+"碗牛肉面；总价为"+price+"元");

        return price;
    }

    public static void main(String[] args) {
        Chef chef = new Chef();
        int money= chef.cookNoodle(2,false,3);
        System.out.println(money);
    }
}
